<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			div{
				height: 200px; 
				width: 200px;
				border: 1px solid red;
			}
		</style>
		<script>
			function showDiv()
			{
				var d=document.getElementById("d2");
				alert("高度是"+d.style.height);//只能获得行内样式
			}
		</script>
	</head>
	<body>
		<div style="height: 200px; width: 200px;border: 1px solid red;" id="d">
			xxx
		</div>
		<div id="d2">
			
		</div>
		<input type="button" value="获得div高度" onclick="showDiv()"/>
	</body>
</html>
